const Koa = require("koa");
const app = new Koa();

const bodyParser = require("koa-bodyparser");
app.use(bodyParser());

const Router = require("koa-router");
const router = new Router({
  prefix: "/api",
});

router.get("/list", (ctx) => {
  ctx.body = {
    msg: "koa get",
  };
});

router.post("/list", (ctx) => {
  ctx.body = {
    msg: "koa post",
  };
});

app.use(router.routes());

app.listen(3000);
